Imports System.Xml.Serialization

Public MustInherit Class NavigationPropertyBase
    Inherits XEntityModelElementWithDocumentationBase

    ''' <summary>Initializes an instance of the <see cref="XEntityModelElementBase" /> class.</summary>
    ''' <param name="localName">The local name of the new element.</param>
    ''' <param name="namespaceName">The name of the namespace of the new element.</param>
    Protected Sub New(ByVal localName As String, ByVal namespaceName As String)
        Me.New(New XElement(XName.Get(localName, namespaceName)))
    End Sub

    ''' <summary>Initializes an instance of the <see cref="NavigationPropertyBase" /> class.</summary>
    ''' <param name="namespace">The <see cref="XNamespace"/> that the element requires.</param>
    Protected Sub New(ByVal [namespace] As XNamespace)
        MyBase.New(New XElement([namespace] + "NavigationProperty"))
    End Sub

    ''' <summary>Initializes an instance of the <see cref="NavigationPropertyBase" /> class.</summary>
    ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
    Protected Sub New(ByVal other As XElement)
        MyBase.New(other)
    End Sub

    <XmlAttribute()> _
    Public Shadows Property Name() As String
        Get
            Return Me.@Name
        End Get
        Set(ByVal value As String)
            Me.@Name = value
        End Set
    End Property

    <XmlAttribute()> _
    Public Property Relationship() As String
        Get
            Return Me.@Relationship
        End Get
        Set(ByVal value As String)
            Me.@Relationship = value
        End Set
    End Property

    <XmlAttribute()> _
    Public Property ToRole() As String
        Get
            Return Me.@ToRole
        End Get
        Set(ByVal value As String)
            Me.@ToRole = value
        End Set
    End Property

    <XmlAttribute()> _
    Public Property FromRole() As String
        Get
            Return Me.@FromRole
        End Get
        Set(ByVal value As String)
            Me.@FromRole = value
        End Set
    End Property

End Class
